// 1,1
// South East
beginoutdoorscript;

variables;
short choice;

body;

beginstate INIT_STATE;
// This state called whenever this section is loaded into memory.
break;

beginstate START_STATE;
// Starting state of the section, called every turn the party 
// stands inside this section until you change the state.
break;

beginstate 10;
if(get_flag(250,7) == 0)
	print_str_color("The farmers greet you nervously and wish you luck on your quest.",2);
if(get_flag(250,7) == 1)
	print_str_color("The farmers cheer your name and greet you as a hero.",2);
break;

beginstate 11;
if(get_flag(250,7) == 0)
	message_dialog("You walk up to the farmhouse looking for information. You are greeted warmly, and with a strange story. The farmers say that golems destroyed the farm to the south, but when they marched towards this farm, they fell apart.","They urge you to look at the hills to the south, this is evidently where the golems begin to fall apart.");
if(get_flag(250,7) == 1)
	message_dialog("The residents of this farmhouse run out to greet you. They shower you with thanks and gratitude for your deeds. Confused, you ask them how they already knew about it.","_Reports have been coming in that all the golems simply collapsed and died. We knew it had to be your doing. Thank you for saving Keilan!._");
break;

beginstate 12;
if(get_flag(250,7) == 0)
	message_dialog("This guard tower is the first sign of a military presence in Keilan you approach the gates and are met by a young soldier. _Adventurers, we have been told of your arrival in Keilan._","_I have been informed to tell you that, although your efforts are appreciated, you will have to look for help elsewhere. The militia of Keilan simply is not equipped to help. Good day. With that the gates are closed._");
if(get_flag(250,7) > 0)
	message_dialog("When the soldiers at the gate recognize you, they hurriedly open the gate and usher you inside. All the soldiers in the garrisson come out to congratulate and thank you, including Commander Leene.","The commander shakes your hand and offers you a bed and warm meal. _You have done a great service to our city. I am forever grateful._");
break;

beginstate 13;
if(get_flag(200,1) == 0)
{	message_dialog("An abandoned quarry lies below you. Golems now occupy it, you can golems moving around inside, digging out the raw materials necessary to create more of their brethren.","");
	set_flag(200,1,1); }
break;



beginstate 17;
	message_dialog("This group of golems was preocuppied with mining ores and rocks for the creation of new golems. They had completely ignored you, and continued obliviously with their task.","That was until you distrubed them, whereupon they were to glad to set upon you.");
break;

beginstate 18;
	if(get_flag(200,2) == 0)
	{	message_dialog("This farm was destroyed by the golems. Strangely enough, the nearby farms to the north are completely untouched. You see rubble from fallen golems scattered around, surprising considering that the people of Keilan are incapable of affectively fighting.","This certainly bears looking in to.");
		set_flag(200,2,1);
		end(); }
	print_str_color("You poke through the rubble of a ruined farm but find little new.",2);
break;

beginstate 19;
	if(get_flag(200,3) == 0)
	{	message_dialog("There is a great deal of rubble on this hill. A close look reveals that it isn't rubble, but scattered golem parts. The parts stretch for miles, but never get very close to Keilan and the first parts begin on the top of this slope.","The golems seem to march up to this point then begin to fall apart. This supports several claims that you have heard from residents of Keilan. The golems certainly seem hesitant to come any further, a large group is half way down the hill standing guard.");
		set_flag(200,3,1);
		end(); }
	print_str_color("The ground here is littered with parts of fallen golems.",2);
break;

beginstate 20;
	if(get_flag(200,5) == 0)
	{	message_dialog("A well hidden trail was carved through the mountains here, you aren't sure what its purpose was, but it probably wasn't legal. Now the pass can help you avoid the golems on the slopes nearby.","");
		set_flag(200,5,1); }
break;

beginstate 21;
	message_dialog("The ruins of Jszoula Keep stands above you. It must have once been a magnificent structure, built on the sides of a tremendous cliffs its towers soar hundreds of feet into the air. At least you assume they did, they now lie on the ground in ruin.","You wander the ruined town for hours but find no sign of life. Realizing that this isn't furthering your search in any way, you leave.");
	block_entry(1);
break;

beginstate 22;
	if(get_flag(10,9) == 1)
		end();
	if(get_flag(200,4) == 0)
	{	set_state_continue(23);
		end(); }
break;

beginstate 23;
if(get_flag(200,4) == 0)
	if(get_flag(10,9) == 0)
	{
	reset_dialog();
	add_dialog_str(0,"If you get any closer you'll have to fight the large group of golems guarding these slopes. This might not be a great idea, they vastly outnumber you.",0);
	add_dialog_Str(1,"For now the golems seem content with staying where they are. It's your choice whether or not you want to continue on.",0);
	add_dialog_choice(0,"Fight them.");
	add_dialog_choice(1,"Try to sneak by.");
	add_dialog_choice(2,"Leave.");
	choice = run_dialog(1);
	if(choice == 1)
	{	create_out_spec_enc(1);
		end(); }
	if(choice == 2)
	{	message_dialog("The golems easily spot you and attack you. That certainly didn't work.","");
		create_out_spec_enc(1);
		end(); }
	if(choice == 3)
	{	message_dialog("You turn back, the golems don't pursue you.""");
		block_entry(1);
		end(); }
}
break;

beginstate 24;
if(get_flag(200,4) == 0)
	if(get_flag(10,9) == 0)
	{	message_dialog("The golems were loathe to attack anyone standing at the top of hill due to the fact that it evidently made them fall apart. They don't have the same limitations for someone standing on the bottom of the hill. They set upon you.","");
		create_out_spec_enc(1);
}
break;

beginstate 25;
	if(get_flag(200,6) == 0)
	{	message_dialog("A trail has been carved into the cliff leading up. The ascent is a frightful one, a shear drop to your imminent deaths stretches out to one side. To the other is the reassuring presence of the cliff wall.","You count yourself as a brave group of adventurers, but needless to say you keep against the wall.");
		set_flag(200,6,1); }
break;

beginstate 26;
if(get_flag(200,21) == 0)
{	message_dialog("Terraces have been cut into the hills here to allow for more arable land. There are not workers in the fields, and the reason is soon evident. You reach the farmer's residence, which was also carved into the hills, and find it abandoned.","");
	set_flag(200,21,1);
}
	else print_str_color("You pass by the abandoned farm, nothing of interest here.",2);
break;

beginstate 27;
	if(character_in_party(513) >= 4)
		if(get_flag(5,4) == 0)
		{	message_dialog("Glup looks confused, _Where are we going? I don't think that there are going to be any bog shrooms up in the mountains. If you're giving up our quest, then please take me back to my village._","");
			block_entry(1); }
break;

beginstate 28;
	if(get_flag(200,4) == 0)
		message_dialog("You can see a group of golem sentries midway up the hill to the north. If you proceed any further they may notice you.","");

break;